package edu.zut.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

//标明当前类是一个组件类，它的对象创建权会自动交给Spring容器管理
@Component
public class Student {
    //@Value("${key}")   根据key从容器中自动获取value并注入到标注的属性上
    @Value("${name}")
    private String name;
    @Value("${age}")
    private String age;
    @Value("${school}")
    private String school;
    @Value("${habit}")
    private List<String> habit;



    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                ", school='" + school + '\'' +
                ", habit=" + habit +
                '}';
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }

    public List<String> getHabit() {
        return habit;
    }

    public void setHabit(List<String> habit) {
        this.habit = habit;
    }
}
